cmake_minimum_required(VERSION 2.6)
project(span-tree)

#include_directories("${PROJECT_BINARY_DIR}")

# OpenMP
find_package(OpenMP REQUIRED)
if (OPENMP_FOUND)
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
else ()
    message(FATAL_ERROR "OpenMP is required")
endif ()

find_package(MPI REQUIRED)

include_directories(${PROJECT_SOURCE_DIR}/src)

add_executable(span_tree span_tree.cpp)
add_executable(undirected_graph undirected_graph.cpp)
add_executable(t1 test.cpp)
add_executable(t2 test2.cpp)
#add_executable(t3 test3.cpp)
add_subdirectory(omp_exercise)

target_link_libraries(span_tree
        PRIVATE
        ${MPI_C_LIBRARIES})

add_definitions(-std=c++11 -O3 -lboost -DHAVE_CXX0X -march=native -W -DINFO -DNDEBUG -DOMPI_SKIP_MPICXX)
